<?php
/**
 * 重庆柯一网络有限公司
 * 遵循MT协议，开源并可商业使用，没有任何限制
 * @Author:cqkyi
 * @Date: 2020/9/27 9:48
 * 官方惟一地址：www.cqkyi.com
 */

namespace app\common\model\admin;


use app\common\utils\Res;
use think\Model;

class FilesModel extends Model
{

    protected $name="files";
    protected $pk="f_id";


    public static function add($param)
    {
        try {

            $filesModel = new FilesModel();
            $filesModel->save($param);
            return  Res::Modelok("添加成功");
        }catch (\PDOException $exception){
            return Res::ModelMsg($exception->getMessage());
        }
    }


    public static function pageMap($map,$offset,$limit){
        return self::where($map)->limit($offset, $limit)->order('f_id desc')->select();
    }

    public static function pageMapCount($map){
        return self::where($map)->count();
    }


}